<template>
<div style="height: 50px; line-height: 50px; border-bottom: 1px solid #ccc; display: flex">
  <div style="width: 200px ; padding-left: 30px ;font-weight: bold ;color: blue">阿淋海洋世界</div>
  <div style="flex: 1"></div>
  <div style="width: 100px">
<!--    下拉菜单-->
    <el-dropdown>
    <span class="el-dropdown-link">{{user==null?'':user.username}}<i class="el-icon-arrow-down el-icon--right"></i>
    </span>
      <template #dropdown>
        <el-dropdown-menu>
          <el-dropdown-item @click="PersonalInformation">个人信息</el-dropdown-item>
          <el-dropdown-item @click="exit">退出系统</el-dropdown-item>
        </el-dropdown-menu>
      </template>
    </el-dropdown>
  </div>

</div>
</template>

<script>
export default {
  name: "Header",

  data(){
    return {
      user :JSON.parse(sessionStorage.getItem('user')),
    }
  },
  methods :{
    exit(){
      this.$router.push('/login')
    },
    PersonalInformation(){
      this.$router.push('/person')
    }
  }
}

</script>

<style scoped>

</style>